import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

const state = {
    headerTitle:"",
    userName:"",
    userPhone:"",
    inputName:"",
    inputPhone:"",
    inputFrid:"",
    inputBankNo:"",
    alertContent:"",
    checkNumber:"",
    validateData:"",
    localId:"",
    isSubmit:"",
    isAlert:false,
    isLoading:false,
    validata:[]
}

const mutations = {
    changeTitle(state,htitle){
        state.headerTitle = htitle;
    },
    changeInputName(state,nameValue){
        state.inputName = nameValue;
    },
    changeinputPhone(state,phoneValue){
        state.inputPhone = phoneValue;
    },
    changeInputFrid(state,fridValue){
        state.inputFrid = fridValue;
    },
    changeInputBankNo(state,bankNoValue){
        state.inputBankNo = bankNoValue;
    },
    changeUserPhone(state,userPhoneValue){
        state.userPhone = userPhoneValue;
    },
    changeAlertContent(state,alertValue){
        state.alertContent = alertValue;
    },
    changeCheckNumber(state,checkNumberValue){
        state.checkNumber = checkNumberValue;
    },
    changeValidateData(state,validateData){
        state.validateData = validateData;
    },
    changeLocalId(state,localIdValue){
        state.localId = localIdValue;
    },
    changeIsSubmit(state,isSubmitValue){
        state.isSubmit = isSubmitValue;
    },
    changeIsAlert(state,isAlertValue){
        state.isAlert = isAlertValue;
    },
    changeIsLoading(state,isLoadingValue){
        state.isLoading = isLoadingValue;
    },
    pushValidata(state,vdata){
        state.validata.push(vdata);
    },
    emptyValidata(state){
        state.validata = [];
    }

}

export default new Vuex.Store({
    state,
    mutations
})
